<?php

use yii\db\Migration;

/**
 * Class m190328_083011_add_cloumn_code_on_table_goods
 */
class m190328_083011_add_cloumn_code_on_table_goods extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('goods', 'code', $this->string()->comment("代号"));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {

        $this->dropColumn('goods', 'code');

        return true;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190328_083011_add_cloumn_code_on_table_goods cannot be reverted.\n";

        return false;
    }
    */
}
